var a,b,c
a = 20
b = 10
c = 40
if(b<c){[b,c]=[c,b]}
if(a<b){[a,b]=[b,a]}
console.log(a,b,c)